﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;

/// <summary>
/// Copyright (C)   jinggubang
/// FileName:        againLogin.aspx.cs         
/// Author :         Wangbc
/// CDT:             2011-04-01           
/// Version:         1.0.0.0                
/// Depiction:       重新登录 
/// </summary>
public partial class againLogin : System.Web.UI.Page
{
    /// <summary>
    /// 初始化
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        //清空Session
        Session.Clear();
        string exit = Request.QueryString["FUN"];

        if (exit != "exit")
        {

            string path = Request.ApplicationPath;
            if (path == "/")
            {
                path = "";
            }
            StringBuilder sbr = new StringBuilder();
            sbr.AppendFormat("<script language=\"javascript\">{0}", Environment.NewLine);
            sbr.AppendFormat("alert(\"");
            sbr.AppendFormat("登录超时，请重新登录");
            sbr.AppendFormat("\");window.top.location='" + path + "/againLogin.aspx?FUN=exit';</script>{0}", Environment.NewLine);
            Page.ClientScript.RegisterStartupScript(Page.GetType(), "Startup", sbr.ToString());
        }
        else
        {
            //跳转到登录页
            Server.Transfer("login.aspx");
        }
    }
}
